local skel = fk.CreateSkill {
  name = "#moon_stick_skill",
  attached_equip = "moon_stick",
  tags = {Skill.Compulsory},
}

skel:addEffect(fk.CardUsing, {
  anim_type = "drawcard",
  frequency = Skill.Compulsory,
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and data.card.trueName == "slash"
    and data.card.number > 0 and data.card.suit ~= Card.NoSuit
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local ids = room:getCardsFromPileByRule("charm|"..data.card.number.."|"..data.card:getSuitString(), 1, "allPiles")
    if #ids > 0 then
      room:obtainCard(player, ids, true, fk.ReasonJustMove, player.id, self.name)
    end
  end,
})

Fk:loadTranslationTable{
  ["#moon_stick_skill"] = "魔月杖",
}

return skel
